<div id='cont_report' style=' font-family: arial,helvetica,sans-serif; font-size: 10px;'>
<table style="width: 720px; height: 54px;" border="0" align="center">
<tbody>
<tr>
<td>Universidad de El Salvador</td>
<td style="text-align: right;"><?php 
		
      date_default_timezone_set('America/El_Salvador');
      $date = date('d-M-Y'); 
       echo $date;
	  		?></td>
</tr>
<tr>
<td>Facultad de Jurisprudencia y Ciencias Sociales</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Comit&eacute; Local de Autoevaluaci&oacute;n</td>
<td>&nbsp;</td>
</tr>
</tbody>

<?php foreach ($nombres as $row) { ?>
	</table>
	<table style="width: 720px; height: 37px;" border="0" align="center">
	<tbody>
	<tr>
	<td style="text-align: center;">CUESTIONARIO PARA LA EVALUACION DEL PERSONAL ACADEMICO POR PARTE DEL ESTUDIANTE</td>
	</tr>
	<tr>
	<td style="text-align: center;"><?php echo $row['ciclo_anho']; ?></td>
	</tr>
	</tbody>
	</table>
	<table style="width: 720px; height: 37px; border-collapse: collapse;" border="1" align="center">
	<tbody>
	<tr>
	<td style="text-align: center;"><strong>Resultados por Escuela/Departamento:</strong></td>
	</tr>
	<tr>
	<td style="text-align: center;"><strong><?php echo ascii_to_entities($row['nombre_unidad']); ?></strong></td>
	</tr>
	</tbody>
	</table>
<?php } ?> 	
<br>
<table style="width: 720px; height: 44px; border-collapse: collapse;" border="1" align="center">
<tbody>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>Aspecto/Sub-Factores&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Calificaci&oacute;n Prom.</td>
</tr>
</tbody>
</table>
<br>

<?php $total = 0; foreach($preguntas as $red): {?>
	<table style="width: 720px; height: 44px; border-collapse: collapse;" border="1" align="center">
	<tbody>
	<tr>
	<td colspan="3"><?php echo $red['pregunta']; ?></td>
	</tr>
	<?php foreach($opciones as $opc): {
				if($red['id_pregunta'] == $opc['id_pregunta']) {?>
					<tr>
					<td><?php echo $opc['id_opcion']; ?>.</td>
					<td style="width: 90%;" align="left" valign="middle"><?php echo ascii_to_entities($opc['opcion']); ?></td>
					<td align="right"><?php echo $opc['round']; ?></td>
					</tr>
				<?php }
			} endforeach; ?>
	<?php foreach($promedio as $opc): {
				if($red['id_pregunta'] == $opc['id_pregunta']) {?>
					<tr>
					<td colspan="2" style="width: 90%;" align="left" valign="middle"><b>Promedio/Aspecto</b></td>
					<?php $total = $total + $opc['promedio']; ?>
					<td align="right"><b><?php echo $opc['promedio']; ?></b></td>
					</tr>
				<?php }
			} endforeach; ?>
	</tbody>
	</table>
	<br>
<?php }	endforeach; ?>

<br><table style="width: 720px; height: 44px; border-collapse: collapse;" border="1" align="center"><tr>
					<td colspan="2" style="width: 90%;" align="left" valign="middle"><b>Promedio</b></td>
					<td align="right"><b><?php echo $total; ?></b></td>
</table></tr>
</div>

